<?php
   define('ACC', true);
require('./include/init.php');
session_start(); 
//print_r($_SESSION);
$userid = $_SESSION['user_id'];
//$userid = 26;

$company = new companymodel();
$companyinfo = $company->getcompanyinfo($userid);
$companyid = $companyinfo['company_id']; 
$company_y = $companyinfo['company_y'];
$company_q = $companyinfo['company_q'];

$order = $company->getorder($companyid);
echo '
               <table  class="table table-striped table-bordered table-hover">
                <thead>
                <tr><th>产品</th>
                    <th>数量</th>
                    <th>价格</th>
                    <th>付款周期</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

';


foreach($order as $k=>$v){
    echo '<tr><td>' . $company->getelementname($v['element_id']) . '</td><td>' . $v['order_number'] . '</td><td>' . $v['order_price'] . '</td><td>' . $v['order_payment'] . '个季度</td><td>';
//此处加入交付按钮，需要对按钮的id编号，之后在ajax中控制其动作
    echo '<button type="button" class="btn btn-primary sell" id="sellorder1">交付</button>';
    echo '</td></tr>';
}

echo '
                </tbody> 
                </table>
';

?>
